package cranim.simulation;

import cranim.Constants;
import cranim.crparsing.ParseFleet;

/**
 *
 * @author Benedikt
 */
public class Player implements Constants{
    
    private String name;
    private String coords;
    private int[] techs;
    private Fleet fleet;
    private ParseFleet parsedFleet;
    private boolean isattacker;
    
    public Player(String name, String coords, int[] techs, ParseFleet parsedFleet, boolean isattacker){
        this.name = name;
        this.coords = coords;
        this.techs = techs;
        this.fleet = new Fleet(techs, parsedFleet,isattacker);
        this.parsedFleet = parsedFleet;
    }
    
    public Player(String name, String coords, int[] techs, Fleet fleet, boolean isattacker){
        this.name = name;
        this.coords = coords;
        this.techs = techs;
        this.fleet = fleet.cloneFleet();
        
    }
    
    public Player(String name, int[] techs, ParseFleet parsedFleet, boolean isattacker){
        this(name, DEFAULT_COORDS, techs, parsedFleet, isattacker);
    }
    
    public Player clonePlayer(){
        return new Player(name, coords, techs, fleet, isattacker);
    }
    
    public String getName(){
        return name;
    }
    
    public Fleet getFleet(){
        return fleet;
    }
    
    public int[] getTechs(){
        return techs;
    }
    
    public int getShieldTech(){
        return techs[SHIELDS];
    }
    
    public String getCoords(){
        return coords;
    }
}
